package com.ruoyi.demo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.demo.mapper.DemoShopMapper;
import com.ruoyi.demo.domain.DemoShop;
import com.ruoyi.demo.service.IDemoShopService;

/**
 * 商品Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-14
 */
@Service
public class DemoShopServiceImpl implements IDemoShopService 
{
    @Autowired
    private DemoShopMapper demoShopMapper;

    /**
     * 查询商品
     * 
     * @param shopId 商品主键
     * @return 商品
     */
    @Override
    public DemoShop selectDemoShopByShopId(Long shopId)
    {
        return demoShopMapper.selectDemoShopByShopId(shopId);
    }

    /**
     * 查询商品列表
     * 
     * @param demoShop 商品
     * @return 商品
     */
    @Override
    public List<DemoShop> selectDemoShopList(DemoShop demoShop)
    {
        return demoShopMapper.selectDemoShopList(demoShop);
    }

    /**
     * 新增商品
     * 
     * @param demoShop 商品
     * @return 结果
     */
    @Override
    public int insertDemoShop(DemoShop demoShop)
    {
        demoShop.setCreateTime(DateUtils.getNowDate());
        return demoShopMapper.insertDemoShop(demoShop);
    }

    /**
     * 修改商品
     * 
     * @param demoShop 商品
     * @return 结果
     */
    @Override
    public int updateDemoShop(DemoShop demoShop)
    {
        demoShop.setUpdateTime(DateUtils.getNowDate());
        return demoShopMapper.updateDemoShop(demoShop);
    }

    /**
     * 批量删除商品
     * 
     * @param shopIds 需要删除的商品主键
     * @return 结果
     */
    @Override
    public int deleteDemoShopByShopIds(Long[] shopIds)
    {
        return demoShopMapper.deleteDemoShopByShopIds(shopIds);
    }

    /**
     * 删除商品信息
     * 
     * @param shopId 商品主键
     * @return 结果
     */
    @Override
    public int deleteDemoShopByShopId(Long shopId)
    {
        return demoShopMapper.deleteDemoShopByShopId(shopId);
    }
}
